{% load i18n pagemagic_admin_tags %}

<div class="inline-group" style="border:0">
    <h2>{% trans "Page content" %}</h2>

    {{ inline_admin_formset.formset.non_form_errors }}
    {{ inline_admin_formset.formset.management_form }}

    <fieldset class="module aligned">
        {% for inline_admin_form in inline_admin_formset %}
            {% if inline_admin_form.form.non_field_errors %}
                <tr><td colspan="{{ inline_admin_form.field_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
            {% endif %}

            <div class="form-row short_title">
                {# ={{ forloop.counter0 }} : {{ inline_admin_form.original }}= #}
                <label>{% show_page_attr_descr forloop.counter0 inline_admin_formset %}:</label>

                {{ inline_admin_form.pk_field.field }} {{ inline_admin_form.fk_field.field }}
                <input
                    type="hidden"
                    {# type="text" class="vTextField" #}
                    id="id_pageattr_set-{{ forloop.counter0 }}-name"
                    name="pageattr_set-{{ forloop.counter0 }}-name"
                    {% if inline_admin_form.original %}
                        value="{{ inline_admin_form.original.name }}"
                        style="color:green"
                    {% else %}
                        value="{% show_page_attr_name forloop.counter0 inline_admin_formset %}"
                        style="color:red"
                    {% endif %}
                />

                <textarea
                    rows="10" cols="40" class="vLargeTextField"
                    id="id_pageattr_set-{{ forloop.counter0 }}-value"
                    name="pageattr_set-{{ forloop.counter0 }}-value"
                {% if inline_admin_form.original %}
                        >{{ inline_admin_form.original.value }}</textarea>
                {% else %}
                        ></textarea>
                {% endif %}
            </div>
        {% endfor %}
    </fieldset>

</div>


